exports.saveUser = function (user) {
  localStorage.setItem("uid", user._id);
  localStorage.setItem("name", user.name);
  localStorage.setItem("beizhu", user.beizhu);
  localStorage.setItem("logined", true);
}

exports.saveLogin = function (token, print_token, print_shop_id,use_printer) {
  localStorage.setItem("access_token", token);
  localStorage.setItem("print_access_token", print_token);
  localStorage.setItem("print_shop_id", print_shop_id);
  localStorage.setItem("use_printer", use_printer);
  localStorage.setItem("logined", true);
}

exports.saveHeadimg = function (imgurl) {
  localStorage.setItem("headimg", imgurl);
}

exports.exit = function () {
  localStorage.removeItem("logined");
  localStorage.removeItem("access_token");

}
